Several Multiprocessing Services functions take a parameter of type Duration
, which specifies the maximum time a task should wait for an event to occur. Multiprocessing Services recognizes four constants which you can use when specifying a duration. Note that you can use these constants in conjunction with other values to indicate specific wait intervals. For example, to wait 1 second, you can pass kDurationMillisecond * 1000
.
enum {
kDurationImmediate = 0L,
kDurationForever = 0x7FFFFFFF,
kDurationMillisecond = 1,
kDurationMicrosecond = -1
};
Constant Descriptions
kDurationImmediate
The task times out immediately, whether or not the event has occurred. If the event occurred, the return status is noErr
. If the event did not occur, the return status is kMPTimeoutErr
(assuming no other errors occurred).
kDurationForever
The task waits forever. The blocking call waits until either the event occurs, or until the object being waited upon (such as a message queue) is deleted.